#pragma region Copyright
/// <copyright>
/// Copyright (c) 2007 Ilia Shramko.
/// Released under the terms of the GNU General Public License.
/// </copyright>
#pragma endregion

#include "stdafx.h"

BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
{
	if(dwReason == DLL_PROCESS_ATTACH)
	{
		ATLTRACE(atlTraceGeneral, TraceLevel::Verbose, "\r\n");
		ATLTRACE_TS(atlTraceGeneral, TraceLevel::Verbose, "DLL_PROCESS_ATTACH\r\n");
	}
	else if(dwReason == DLL_PROCESS_DETACH)
	{
		ATLTRACE_TS(atlTraceGeneral, TraceLevel::Verbose, "DLL_PROCESS_DETACH\r\n");
	}

	return _Module.DllMain(dwReason, lpReserved);
}

STDAPI DllRegisterServer()
{
	return _Module.DllRegisterServer(FALSE);
}

STDAPI DllUnregisterServer()
{
	return _Module.DllUnregisterServer(FALSE);
}

STDAPI DllCanUnloadNow()
{
	HRESULT hr = S_OK;

	if(FAILED(hr) || hr == S_FALSE)
	{
		ATLTRACE_TS(atlTraceGeneral, TraceLevel::Verbose, "DllCanUnloadNow() : 0x%08X\r\n", hr);
		return hr;
	}

	hr = _Module.DllCanUnloadNow();
	ATLTRACE_TS(atlTraceGeneral, TraceLevel::Verbose, "DllCanUnloadNow() : 0x%08X\r\n", hr);

	return hr;
}

STDAPI DllGetClassObject(REFCLSID rClsID, REFIID riid, void** pv)
{
	return _Module.DllGetClassObject(rClsID, riid, pv);
}
